One of the stages within the architecture phase is to define the information model for the message types associated with the messages exchanges between the interacting participants.
This involves defining message schema for each example message. The schema could already exist and be reused, it could be based on existing schema and just need to be upgraded to support new requirements, or it may need to be defined from scratch.
An example of a schema associated with the purchasing model is the store.xsd shown here:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.jboss.org/examples/store" xmlns:tns="http://www.jboss.org/examples/store" elementFormDefault="qualified">
<element name="BuyRequest" type="tns:BuyRequestType"></element>
<element name="BuyConfirmed" type="tns:BuyConfirmedType"></element>
<element name="AccountNotFound" type="tns:AccountNotFoundType"></element>
<element name="BuyFailed" type="tns:BuyFailedType"></element>
<complexType name="BuyRequestType">
<attribute name="id" type="string"></attribute>
<attribute name="product" type="string"></attribute>
<attribute name="customer" type="string"></attribute>
</complexType>
<complexType name="BuyConfirmedType">
<attribute name="id" type="string"></attribute>
<attribute name="amount" type="integer"></attribute>
<attribute name="deliveryDate" type="date"></attribute>
</complexType>
<complexType name="AccountNotFoundType">
<attribute name="id" type="string"></attribute>
<attribute name="reason" type="string"></attribute>
</complexType>
<complexType name="BuyFailedType">
<attribute name="id" type="string"></attribute>
<attribute name="reason" type="string"></attribute>
</complexType>
</schema>
Once the schema has been defined, then the example messages need to be updated to reference the schema, as shown in the following BuyRequest.xml example message:
<tns:BuyRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="http://www.jboss.org/examples/store"
xsi:schemaLocation="http://www.jboss.org/examples/store ../schema/store.xsd "
id="1" product="Laptop" customer="Joe" />